﻿namespace HuaWei
{
    using HuaWei.DAI;
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.Data;
    using System.Runtime.InteropServices;
    using System.ServiceModel;

    [ServiceKnownType(typeof(DbParameter)), ServiceKnownType(typeof(DBNull)), ServiceContract(SessionMode=SessionMode.Allowed)]
    public interface IWCFService
    {
        [OperationContract]
        void BeginTrans();
        [OperationContract]
        void CloseDatabase();
        [OperationContract]
        void Commit();
        [OperationContract(Name="ExecuteDataSet1")]
        DataSet ExecuteDataSet(string productCode, string exeStr, CommandType cmdType);
        [OperationContract(Name="ExecuteDataSet5")]
        DataSet ExecuteDataSet(string productCode, string exeStr, DbParameter[] outParams);
        [OperationContract(Name="ExecuteDataSet2")]
        DataSet ExecuteDataSet(string productCode, string exeStr, CommandType cmdType, string TableName);
        [OperationContract(Name="ExecuteDataSet3")]
        DataSet ExecuteDataSet(string productCode, string exeStr, CommandType cmdType, DbParameter[] inParams);
        [OperationContract(Name="ExecuteDataSet6")]
        DataSet ExecuteDataSet(string productCode, string exeStr, DbParameter[] outParams, string TableName);
        [OperationContract(Name="ExecuteDataSet4")]
        DataSet ExecuteDataSet(string productCode, string exeStr, CommandType cmdType, DbParameter[] inParams, string TableName);
        [OperationContract(Name="ExecuteDataSet7")]
        DataSet ExecuteDataSet(string productCode, string exeStr, CommandType cmdType, DbParameter[] inParams, DbParameter[] outParams);
        [OperationContract(Name="ExecuteDataSet8")]
        DataSet ExecuteDataSet(string productCode, string exeStr, CommandType cmdType, DbParameter[] inParams, DbParameter[] outParams, string TableName);
        [OperationContract(Name="ExecuteNonQuery11")]
        bool ExecuteNonQuery(string productCode, ArrayList sqls, CommandType cmdType);
        [OperationContract(Name="ExecuteNonQuery21")]
        bool ExecuteNonQuery(string productCode, Hashtable sqls, CommandType cmdType);
        [OperationContract(Name="ExecuteNonQuery1"), TransactionFlow(TransactionFlowOption.Allowed)]
        int ExecuteNonQuery(string productCode, string exeStr, CommandType cmdType);
        [OperationContract(Name="ExecuteNonQuery3")]
        int ExecuteNonQuery(string productCode, string proName, DbParameter[] outParams);
        [OperationContract(Name="ExecuteNonQuery2")]
        int ExecuteNonQuery(string productCode, string exeStr, CommandType cmdType, DbParameter[] inParams);
        [OperationContract(Name="ExecuteNonQuery4")]
        int ExecuteNonQuery(string productCode, string exeStr, CommandType cmdType, DbParameter[] inParams, DbParameter[] outParams);
        [OperationContract(Name="ExecuteReader1")]
        object ExecuteReader(string productCode, string exeStr, CommandType cmdType);
        [OperationContract(Name="ExecuteReader3")]
        object ExecuteReader(string productCode, string exeStr, DbParameter[] outParams);
        [OperationContract(Name="ExecuteReader2")]
        object ExecuteReader(string productCode, string exeStr, CommandType cmdType, DbParameter[] inParams);
        [OperationContract(Name="ExecuteReader4")]
        object ExecuteReader(string productCode, string exeStr, CommandType cmdType, DbParameter[] inParams, DbParameter[] outParams);
        [OperationContract(Name="ExecuteScalar1")]
        object ExecuteScalar(string productCode, string exeStr, CommandType cmdType);
        [OperationContract(Name="ExecuteScalar3")]
        object ExecuteScalar(string productCode, string exeStr, DbParameter[] outParams);
        [OperationContract(Name="ExecuteScalar2")]
        object ExecuteScalar(string productCode, string exeStr, CommandType cmdType, DbParameter[] inParams);
        [OperationContract(Name="ExecuteScalar4")]
        object ExecuteScalar(string productCode, string exeStr, CommandType cmdType, DbParameter[] inParams, DbParameter[] outParams);
        [OperationContract(Name="GetDs")]
        DataSet GetDs(string productNO, DataSet dsSource, string invokeCode, string param);
        [OperationContract(Name="Invoke")]
        string Invoke(string productNO, DataSet dsSource, string invokeCode, string param);
        [OperationContract(Name="Login1")]
        bool Login(string productNO, string loginName, string password);
        [OperationContract(Name="Login2")]
        bool Login(string productNO, string loginName, string password, out string serverDbType);
        [OperationContract]
        void OpenDatabase();
        [OperationContract]
        void RollBack();
        [OperationContract(Name="SyncData")]
        string SyncData(string productCode, DataSet dsSource);
        [OperationContract(Name="Update3")]
        void Update(string productCode, DataTable table);
        [OperationContract(Name="Update1")]
        void Update(string productCode, DataSet dsUpdate, [Optional, DefaultParameterValue(true)] bool writeLog);
        [OperationContract(Name="Update2")]
        void Update(string productCode, DataSet dsUpdate, string strTableName);
        [OperationContract(Name="Update4")]
        void Update(string productCode, DataSet dsChanges, Dictionary<DataRowState, string[]> updateIndex, params string[] exeStr);

        string ConnectionString { get; set; }

        ConnectionState ConnState { get; }

        string DBType { get; set; }
    }
}

